#ifndef DETALHEMODEL_H
#define DETALHEMODEL_H

#include <QAbstractListModel>
#include <detalheitem.h>
#include <complementodetalheitem.h>

class DetalheModel : public QAbstractListModel
{
    Q_OBJECT

public:
    explicit DetalheModel(QObject *parent = 0);

    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    QVariant data(const QModelIndex &index, int role) const;

signals:
    void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);

private:
    QList<DetalheItem*> _lista;
    
public slots:    
    void detalheAdd(DetalheItem *item);
    void limpar();
    void refresh();
};

#endif // DETALHEMODEL_H
